<!DOCTYPE html>
<html>
<head>
  {% block head %}
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>OPA | {% block title %}{% endblock %}</title>
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <!-- Bootstrap -->
    <link rel="stylesheet" href="/static/css/bootstrap.min.css">
    <!-- Font Awesome -->
    <link rel="stylesheet" href="/static/bower_components/font-awesome/css/font-awesome.min.css">
    <!-- Ionicons -->
    <link rel="stylesheet" href="/static/bower_components/Ionicons/css/ionicons.min.css">
    <!-- AdminLTE Theme style -->
    <link rel="stylesheet" href="/static/css/AdminLTE.min.css">
    <link rel="stylesheet" href="/static/css/skin-blue.css">
  {% endblock %}
</head>

<body class="hold-transition skin-blue sidebar-mini">
<!--给body添加class: sidebar-collapse 可实现默认的侧边栏收起效果-->
<div class="wrapper">

  <!-- 顶部栏 -->
  <header class="main-header">
    <!-- Logo -->
    <a href="/" class="logo">
      <!-- mini logo for sidebar mini 50x50 pixels -->
      <span class="logo-mini"><b>OPA</b></span>
      <!-- logo for regular state and mobile devices -->
      {#      <span class="logo-lg"><img src="/static/yy.png" class="img-circle"><b>运维管理平台</b></span>#}
      <span class="logo-lg"><b>OPA</b>dmin</span>

    </a>
    <!-- Header Navbar -->
    <nav class="navbar navbar-static-top" role="navigation">
      <!-- Sidebar toggle button-->
      <a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
        <span class="sr-only">Toggle navigation</span>
      </a>
      <!-- Navbar Right Menu -->
      <div class="navbar-custom-menu">
        <ul class="nav navbar-nav">

          {% if session['role'] in ['superadmin', 'admin'] %}
            <li class="tasks-menu"><a href="#">管理员：{{ session['username'] }}</a></li>
            <li class="tasks-menu"><a href="/admin"><i class="fa fa-database"></i></a></li>
          {% else %}
            <li class="tasks-menu"><a href="#">{{ session['username'] }}</a></li>
          {% endif %}

          <li class="tasks-menu"><a href="/logout"><i class="fa fa-sign-out"></i></a></li>
        </ul>
      </div>
    </nav>
  </header>

  <!-- 左侧边栏 -->
  <aside class="main-sidebar">
    <!-- sidebar: style can be found in sidebar.less -->
    <section class="sidebar">
      <!-- search form -->
      <!--      <form action="#" method="get" class="sidebar-form">-->
      <!--        <div class="input-group">-->
      <!--          <input type="text" name="q" class="form-control" placeholder="搜索...">-->
      <!--          <span class="input-group-btn">-->
      <!--                <button type="submit" name="search" id="search-btn" class="btn btn-flat"><i class="fa fa-search"></i>-->
      <!--                </button>-->
      <!--              </span>-->
      <!--        </div>-->
      <!--      </form>-->
      <!-- /.search form -->
      <!-- Sidebar Menu -->
      <ul class="sidebar-menu" data-widget="tree">
        <li class="header">导航栏</li>
        <!-- Optionally, you can add icons to the links -->
        <li {% if active=='nav' %} class='active' {% endif %}><a href="/nav"><i class="fa fa-map"></i> <span>导航页</span></a>
        </li>

        <li class="treeview {% if active.startswith('mon') %} active {% endif %} ">
          <a href="#">
            <i class="fa fa-line-chart"></i><span> 监测数据</span><span class="pull-right-container">
            <i class="fa fa-angle-left pull-right"></i></span>
          </a>
          <ul class="treeview-menu">
{#            <li {% if active=='mon_aval' %} class='active' {% endif %}><a href="/mon/aval"><i#}
{#              class="fa fa-line-chart"></i>可用性监测</a></li>#}
            <li {% if active=='mon_weekly' %} class='active' {% endif %}><a href="/mon/weekly"><i
              class="fa fa-desktop"></i>监测周报（集群）</a></li>
            <li {% if active=='mon_weekly_service' %} class='active' {% endif %}><a href="/mon/weekly/service"><i
              class="fa fa-cubes"></i>监测周报（微服务）</a></li>
            <li {% if active=='mon_api_test' %} class='active' {% endif %}><a href="/mon/api_test"><i
              class="fa fa-list-ul"></i>API巡检</a></li>
          </ul>
        </li>


        <li {% if active=='job' %} class='active' {% endif %}><a href="/job"><i class="fa fa-check-circle"></i> <span>工单审批</span></a>
        </li>

        <li class="treeview {% if active.startswith('alarm') %} active {% endif %} ">
          <a href="#">
            <i class="fa fa-warning"></i><span> 告警管理</span><span class="pull-right-container">
            <i class="fa fa-angle-left pull-right"></i></span>
          </a>
          <ul class="treeview-menu">
            <li {% if active=='alarm_prom' %} class='active' {% endif %}><a href="/alarm/prom"><i
              class="fa fa-circle-o"></i>Prometheus</a></li>
            <li {% if active=='alarm_skw' %} class='active' {% endif %}><a href="/alarm/skw"><i
              class="fa fa-circle-o"></i>Sky Walking</a></li>
          </ul>
        </li>


        <li class="treeview {% if active.startswith('cluster') %} active {% endif %} ">
          <a href="#">
            <i class="fa fa-sitemap"></i>
            <span>K8s管理</span><span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
          </a>
          <ul class="treeview-menu">
            <li {% if active=='cluster_dashboard' %} class='active' {% endif %}><a href="/cluster"><i
              class="fa fa-cloud"></i>概况</a></li>
            <li {% if active=='cluster_pods' %} class='active' {% endif %}><a href="/cluster/pods/"><i
              class="fa fa-circle-o"></i>容器组</a></li>
            <li {% if active=='cluster_deployments' %} class='active' {% endif %}><a href="/cluster/deployments/"><i
              class="fa fa-circle-o"></i>无状态</a></li>
            <li {% if active=='cluster_statefulsets' %} class='active' {% endif %}><a href="/cluster/statefulsets"><i
              class="fa fa-circle-o"></i>有状态</a></li>
            <li {% if active=='cluster_daemonsets' %} class='active' {% endif %}><a href="/cluster/daemonsets"><i
              class="fa fa-circle-o"></i>守护集</a></li>
            <li {% if active=='cluster_services' %} class='active' {% endif %}><a href="/cluster/services"><i
              class="fa fa-circle-o"></i>服务</a></li>
            <li {% if active=='cluster_ingresses' %} class='active' {% endif %}><a href="/proxy"><i
              class="fa fa-circle-o"></i>路由</a></li>
            <li {% if active=='cluster_configmaps' %} class='active' {% endif %}><a href="/cluster/configmaps"><i
              class="fa fa-circle-o"></i>配置项</a></li>
            <li {% if active=='cluster_pv' %} class='active' {% endif %}><a href="/cluster/persistentvolumes"><i
              class="fa fa-circle-o"></i>存储卷</a></li>
            <li {% if active=='cluster_pvc' %} class='active' {% endif %}><a href="/cluster/persistentvolumeclaims"><i
              class="fa fa-circle-o"></i>存储声明</a></li>
          </ul>
        </li>

        <li class="treeview {% if active.startswith('cmdb') %} active {% endif %} ">
          <a href="#">
            <i class="fa fa-bars"></i><span> CMDB</span><span class="pull-right-container">
            <i class="fa fa-angle-left pull-right"></i></span>
          </a>
          <ul class="treeview-menu">
            <li {% if active=='cmdb_home' %} class='active' {% endif %}><a href="/cmdb/home"><i
              class="fa fa-search"></i>全局搜索</a></li>
            <li {% if active=='cmdb_host' %} class='active' {% endif %}><a href="/cmdb/host"><i
              class="fa fa-desktop"></i>主机</a></li>
            <li {% if active=='cmdb_db' %} class='active' {% endif %}><a href="/cmdb/db"><i class="fa fa-database"></i>数据库</a>
            </li>
            <li {% if active=='cmdb_lb' %} class='active' {% endif %}><a href="/cmdb/lb"><i class="fa fa-sitemap"></i>负载均衡</a>
            </li>
            <li {% if active=='cmdb_os' %} class='active' {% endif %}><a href="/cmdb/os"><i class="fa fa-cube"></i>对象存储</a>
            </li>
            <li {% if active=='cmdb_kv' %} class='active' {% endif %}><a href="/cmdb/kv"><i
              class="glyphicon glyphicon-flash"></i>键值存储</a></li>
            <li {% if active=='cmdb_svc' %} class='active' {% endif %}><a href="/cmdb/svc"><i class="fa fa-server"></i>服务</a>
            </li>
            <li {% if active=='cmdb_code' %} class='active' {% endif %}><a href="/cmdb/code"><i class="fa fa-code"></i>代码</a>
            </li>
          </ul>
        </li>

        <li class="treeview {% if active.startswith('cloud') %} active {% endif %} ">
          <a href="#">
            <i class="fa fa-cloud"></i><span> 云运营报表</span><span class="pull-right-container">
            <i class="fa fa-angle-left pull-right"></i></span>
          </a>
          <ul class="treeview-menu">
            <li {% if active=='cloud_resource' %} class='active' {% endif %}><a href="/cmdb/cloud_resource"><i
              class="fa fa-table"></i> <span>资源清单</span></a>
            </li>
            <li {% if active=='cloud_instance' %} class='active' {% endif %}><a href="/cloud/instance_stats"><i
              class="fa fa-circle-o"></i> <span>实例维度统计</span></a>
            </li>
            <li {% if active=='cloud_daily' %} class='active' {% endif %}><a href="/cloud/daily_stats"><i
              class="fa fa-circle-o"></i> <span>日期维度统计</span></a>
            </li>
            <li {% if active=='cloud_project' %} class='active' {% endif %}><a href="/cloud/project_stats"><i
              class="fa fa-circle-o"></i> <span>项目维度统计</span></a>
            </li>
            <li {% if active=='cloud_org' %} class='active' {% endif %}><a href="/cloud/org_stats"><i
              class="fa fa-circle-o"></i> <span>组织维度统计</span></a>
            </li>
          </ul>
        </li>


      </ul>
      <!-- /.sidebar-menu -->
    </section>
    <!-- /.sidebar -->
  </aside>


  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">{% block content %}{% endblock %}</div>
  <!-- ./wrapper -->

</div>
<!-- REQUIRED JS SCRIPTS -->
<!-- jQuery 3 -->
<script src="/static/js/jquery-3.7.0.js"></script>
<!-- Bootstrap 3.3.7 -->
<script src="/static/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>

<!-- SlimScroll -->
<script src="/static/bower_components/jquery-slimscroll/jquery.slimscroll.min.js"></script>
<!-- FastClick -->
<script src="/static/bower_components/fastclick/lib/fastclick.js"></script>
<!-- AdminLTE App -->
<script src="/static/js/adminlte.min.js"></script>
<!-- bootbox -->
<script src="/static/js/bootbox.min.js"></script>

<!-- 自己写的一些常用工具 -->
<script src="/static/js/common_tools.js"></script>

{% block script %}{% endblock %}

</body>
</html>
